package com.jason.bbs.pms.feign.hystrix;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import com.jason.bbs.bean.ResultJson;
import com.jason.bbs.bean.user.UserInfo;
import com.jason.bbs.pms.feign.UserService;

@Component
public class UserHystrix implements UserService {
	@Value("${debug:false}")
	private boolean debug;

	@Override
	public ResultJson find(String account, String password) {
		ResultJson code = new ResultJson();
		if (debug) {
			code.setCode(200);
			code.setMessage("成功");
			List<UserInfo> list=new ArrayList<>();
			UserInfo userInfo = new UserInfo();
			userInfo.setAccount(account);
			userInfo.setPassword(password);
			list.add(userInfo);
			code.put("list", list);
		} else {
			code.setCode(500);
			code.setMessage("用户模块暂时无法提供服务");
		}
		return code;
	}

}
